package org.jeecg.modules.gis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.gis.config.DynamicTableContext;
import org.jeecg.modules.gis.entity.TilePbf;
import org.jeecg.modules.gis.mapper.PbfTileMapper;
import org.jeecg.modules.gis.service.IPbfTileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PbfTileServiceImpl extends ServiceImpl<PbfTileMapper, TilePbf> implements IPbfTileService {
    @Autowired
    PbfTileMapper pbfTileMapper;

    public void saveToTargetTable(TilePbf tilePbf, String targetTableName) {
        DynamicTableContext.setTableName(targetTableName);
        this.save(tilePbf);
    }

    public TilePbf getOneFromTargetTable(QueryWrapper<TilePbf> queryWrapper, String targetTableName) {
        DynamicTableContext.setTableName(targetTableName);
        return this.getOne(queryWrapper);
    }
}
